package com.glodon.paas.search.parser;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class TextParseFactory {

    @Autowired
    @Qualifier("officeTextParser")
    private TextParser officeTextParser;

    @Autowired
    @Qualifier("revitTextParser")
    private TextParser revitTextParser;

    public TextParser getTextParser(String type) {
        if ("doc".equals(type)) {
            return officeTextParser;
        } else if ("rvt".equals(type)) {
            return revitTextParser;
        } else {
            return null;
        }
    }

}
